package com.xtedu.examproject.dao.base;

import com.xtedu.examproject.entity.ExamQuestion;
import com.xtedu.examproject.util.PageHelper;

import java.util.List;
import java.util.Map;

public interface ExamQuestionDao extends BaseDao<ExamQuestion> {
    PageHelper<ExamQuestion> findPageByType(int questionTypeId, int pageIndex, int pageSize);

    PageHelper<ExamQuestion> findPageByCourse(int courseId, int pageIndex, int pageSize);

    PageHelper<ExamQuestion> findPageBySubject(int subjectId, int pageIndex, int pageSize);

    int[] insertBatch(List<Map<String, Object>> questions);

    List<ExamQuestion> randomQuestions(int courseId,int questionTypeId, int questionCount);

    public List<Map<String, Object>> getQuestionTypeStats() throws Exception;
    public PageHelper<ExamQuestion> findPageByCourseAndType(Integer courseId, Integer questionTypeId, int pageIndex, int pageSize);

    /**
     * 搜索题目
     */
    PageHelper<ExamQuestion> searchQuestions(Integer courseId, Integer questionTypeId, String searchText, int pageIndex, int pageSize);

}
